<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>

</head>
<body>
    <div id="app">
        <p @click="printArg(1,'字符串',[1,2,3])">匿名参数</p>
        <p @click="printArg(msg,num,arr,day)">事件源参数</p>
        <p v-on:click="printArg(this)">页面参数this</p>
        <p v-on:click="printEvent(msg,$event)">事件源对象</p>
        <p>msg:{{msg}}</p>
        <input type="text" value="" @input="msg=$event.target.value">
        <input type="text" value="" @input="setMsg($event)">

    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                msg:"消息",
                num:10,
                arr:[1,2,3],
                day:new Date()
            },
            methods:{
                printArg(...arg){
                    console.log(arg);
                },
                printEvent(arg,e){
                    console.log(arg,e)
                    console.log(e)
                },
                setMsg(e){
                    this.msg=e.target.value
                }
            }
        })
    </script>
</body>
</html>